import { FormSchema } from '/@/components/Form/index';

export interface ListItem {
  key: string;
  title: string;
  description: string;
  extra?: string;
  avatar?: string;
  color?: string;
}

// tab的list
export const settingList = [
  {
    key: '1',
    name: '网站设置',
    component: 'BaseSetting',
  },
  {
    key: '2',
    name: '存储设置',
    component: 'SecureSetting',
  },
  {
    key: '3',
    name: '联系方式',
    component: 'AccountBind',
  },
  {
    key: '4',
    name: '新消息通知',
    component: 'MsgNotify',
  },
];

// 基础设置 form
export const baseSetschemas: FormSchema[] = [
  {
    field: 'WEB_NAME',
    component: 'Input',
    label: '网站名称',
    colProps: { span: 18 },
  },
  {
    field: 'WEB_SUMMARY',
    component: 'Input',
    label: '网站描述',
    colProps: { span: 18 },
  },
  {
    field: 'SEO_KEYWORD',
    component: 'Input',
    label: 'seo关键字',
    colProps: { span: 18 },
  },
  {
    field: 'WEB_ADMIN_NAME',
    component: 'Input',
    label: '网站管理员',
    colProps: { span: 18 },
  },
  {
    field: 'WEB_ICP',
    component: 'Input',
    label: '备案号',
    colProps: { span: 18 },
  },
];

// 安全设置 list
export const secureSettingList: FormSchema[] = [
  {
    field: 'UPLOAD_ADMIN_URL',
    component: 'Input',
    label: '文件域名',
    colProps: { span: 18 },
  },
  {
    field: 'UPLOAD_TYPE',
    component: 'RadioGroup',
    label: '存储方式',
    defaultValue: '1',
    colProps: { span: 18 },
    componentProps: {
      options: [
        {
          label: '本地',
          value: '0',
        },
        {
          label: '七牛',
          value: '1',
        },
        {
          label: '又拍',
          value: '2',
        },
      ],
    },
  },
  {
    field: 'field2',
    component: 'Input',
    label: '七牛',
    colProps: { span: 18 },
    ifShow: ({ values }) => {
      return values.UPLOAD_TYPE === '1';
    },
  },
  {
    field: 'UPLOAD_UP_BUCKET',
    component: 'Input',
    label: '存储空间(bucket)',
    colProps: { span: 18 },
    ifShow: ({ values }) => {
      return values.UPLOAD_TYPE === '2';
    },
  },
  {
    field: 'UPLOAD_UP_USERNAME',
    component: 'Input',
    label: '用户名',
    colProps: { span: 18 },
    ifShow: ({ values }) => {
      return values.UPLOAD_TYPE === '2';
    },
  },
  {
    field: 'UPLOAD_UP_PASSWORD',
    component: 'InputPassword',
    label: '密码',
    colProps: { span: 18 },
    ifShow: ({ values }) => {
      return values.UPLOAD_TYPE === '2';
    },
  },
  {
    field: 'UPLOAD_UPAI_PATH',
    component: 'Input',
    label: 'path',
    colProps: { span: 18 },
    ifShow: ({ values }) => {
      return values.UPLOAD_TYPE === '2';
    },
  },
];

// 账号绑定 list
export const accountBindList: ListItem[] = [
  {
    key: '1',
    title: '绑定淘宝',
    description: '当前未绑定淘宝账号',
    extra: '绑定',
    avatar: 'ri:taobao-fill',
    color: '#ff4000',
  },
  {
    key: '2',
    title: '绑定支付宝',
    description: '当前未绑定支付宝账号',
    extra: '绑定',
    avatar: 'fa-brands:alipay',
    color: '#2eabff',
  },
  {
    key: '3',
    title: '绑定钉钉',
    description: '当前未绑定钉钉账号',
    extra: '绑定',
    avatar: 'ri:dingding-fill',
    color: '#2eabff',
  },
];

// 新消息通知 list
export const msgNotifyList: ListItem[] = [
  {
    key: '1',
    title: '账户密码',
    description: '其他用户的消息将以站内信的形式通知',
  },
  {
    key: '2',
    title: '系统消息',
    description: '系统消息将以站内信的形式通知',
  },
  {
    key: '3',
    title: '待办任务',
    description: '待办任务将以站内信的形式通知',
  },
];
